var mongoose = require('../db')

var Schema = mongoose.Schema

var topicSchema = new Schema({
    type: {
        type: String,
        required: true
    },
    title: {
        type: String,
        required: true
    },
    content: {
        type:String,
        required: true
    },
    created_time: {
        type: Date,
        default: Date.now
    },
    last_modified_time: {
        type: Date,
        default: Date.now
    },
    click_num: {
        type: Number,
        default: 0
    },
    call_num: {
        type: Number,
        default: 0
    },
    uId: { // 用户id
        type: Schema.Types.ObjectId,
        required: true
    }
})

module.exports = mongoose.model('Topic', topicSchema)